package com.hxkj.dao.impl;

import com.hxkj.dao.AuthRoleDao;
import com.hxkj.domain.po.AuthRole;
import com.hxkj.mapper.AuthRoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 数据操作实现
 *
 * @author: chenwei
 * @version: 1.0
 * @datetime: 2018-05-21 17:59:26
 */
@Service("authRoleDao")
public class AuthRoleDaoImpl implements AuthRoleDao {

    @Resource
    private AuthRoleMapper authRoleMapper;

    @Override
    public AuthRole get(Long roleId) {
        return authRoleMapper.selectByPrimaryKey(roleId);
    }

    @Override
    public AuthRole findRoleBySiteId(Long siteId) {
        return authRoleMapper.findRoleBySiteId(siteId);
    }

    @Override
    public List<AuthRole> getRoleList(AuthRole authRole) {
        return authRoleMapper.select(authRole);
    }

    @Override
    public int delete(Long roleId) {
        return authRoleMapper.deleteByPrimaryKey(roleId);
    }

    @Override
    public int delete(AuthRole authRole) {
        return authRoleMapper.delete(authRole);
    }

    @Override
    public int deleteRoleByRoleId(Long roleId) {
        return authRoleMapper.deleteRoleByRoleId(roleId);
    }

    @Override
    public int save(AuthRole authRole) {
        return authRoleMapper.insert(authRole);
    }

    @Override
    public int update(AuthRole authRole) {
        return authRoleMapper.update(authRole);
    }

    @Override
    public AuthRole selectRoleName(AuthRole authRole) {
        return authRoleMapper.selectRoleName(authRole);
    }

    @Override
    public AuthRole getRoleBySiteId(Long siteId) {
        return authRoleMapper.getRoleBySiteId(siteId);
    }

    @Override
    public List<AuthRole> getBySlave(AuthRole authRole) {
        return authRoleMapper.select(authRole);
    }
}
